/*
 * BlueMessage.java
 *
 * Created on 16 luglio 2005, 0.56
 *
 * An implementation of Message interface
 *
 * @version 1.1
 * @author Federico Paparoni
 */

package com.javastaff.btfree;


public class BlueMessage implements Message{
    private int length;
    private String mess;
    private byte[] messByte;
    
    /**
     * @param mess Content of the message
     */
    public BlueMessage(String mess) {
        this.mess=mess;
        length=mess.getBytes().length;
        messByte=new byte[length];
        messByte=mess.getBytes();
    }
    
    /**
     * Retrieve the length of the message
     *
     *@return Lenght of the message
     */
    public int getLength() {
        return length;
    }
    
    /**
     * Retrieve a byte array from the message
     *
     * @return Byte array of the message
     */
    
    public byte[] getMessage() {
        return messByte;
    }
    
    
    /**
     * Set the message content
     *
     * @param msg Message content
     * 
     */
    
    public void setMessage(String msg) {
        mess=msg;
    }
}
